package com.econ.powercloud.ems.pojo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class HeWeatherVO {

    @Builder.Default
    List<HeWeather6> HeWeather6 = new ArrayList<>();

    @Data
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class HeWeather6 implements Serializable {

        private Basic basic;

        private Update update;

        private Now now;
        // 接口状态
        private String status;
        //今日预报
        private List<DailyForecast> daily_forecast;


        @Data
        @JsonInclude(JsonInclude.Include.NON_NULL)
        public static class Basic implements Serializable {
            // 地区／城市ID
            private String cid;
            // 地区／城市名称
            private String location;
            // 该地区／城市的上级城市
            private String parent_city;
            // 该地区／城市所属行政区域
            private String admin_area;
            // 该地区／城市所属国家名称
            private String cnty;
            // 地区／城市纬度
            private String lat;
            // 地区／城市经度
            private String lon;
            // 该地区／城市所在时区
            private String tz;
        }

        @Data
        @JsonInclude(JsonInclude.Include.NON_NULL)
        public static class Update implements Serializable {
            // 当地时间，24小时制，格式yyyy-MM-dd HH:mm
            private String loc;
            // UTC时间，24小时制，格式yyyy-MM-dd HH:mm
            private String utc;
        }

        @Data
        @JsonInclude(JsonInclude.Include.NON_NULL)
        public static class Now implements Serializable {
            // 云量
            private String cloud;
            // 实况天气状况代码
            private String cond_code;
            // 实况天气状况描述
            private String cond_txt;
            // 体感温度，默认单位：摄氏度
            private String fl;
            // 相对湿度
            private String hum;
            // 降水量
            private String pcpn;
            // 大气压强
            private String pres;
            // 温度，默认单位：摄氏度
            private String tmp;
            // 能见度，默认单位：公里
            private String vis;
            // 风向360角度
            private String wind_deg;
            // 风向
            private String wind_dir;
            // 风力
            private String wind_sc;
            // 风速，公里/小时
            private String wind_spd;
        }

        @Data
        @JsonInclude(JsonInclude.Include.NON_NULL)
        public static class DailyForecast implements Serializable{
            private String cond_code_d;
            private String cond_code_n;
            private String cond_txt_d;
            private String cond_txt_n;
            private String date;
            private String hum;
            private String mr;
            private String ms;
            private String pcpn;
            private String pop;
            private String pres;
            private String sr;
            private String ss;
            private String tmp_max;
            private String tmp_min;
            private String uv_index;
            private String vis;
            private String wind_deg;
            private String wind_dir;
            private String wind_sc;
            private String wind_spd;
        }
    }
}
